﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="AddPosts.aspx.vb" Inherits="VW_Passat_Community.AddPosts" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .discussionInformation
        {
            height: 10px;
        }
        .style2
        {
            font-style: normal;
            font-size: large;
            color: #3366FF;
        }
        .x6Image
        {
            width: 312px;
            height: 126px;
            text-align: center;
        }
        .addNewPosts
        {
            height: 122px;
        }
        .postsUnedited
        {
            height: 883px;
        }
        .posts
        {
            height: 199px;
        }
        .RateButton
        {
            height: 96px;
        }
        .style3
        {
            float: right;
            width: 312px;
            height: 126px;
            text-align: center;
            font-size: large;
        }
        .AverageRatingPostsAdd
        {
            height: 97px;
        }
        
        .st
        {
            font-size: medium;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="bluecontent">
        <h1 class="headline3">
            Discussion Forum - <em>Reply to the discussion...</em>
        </h1>
    </div>
    <div>
        <div class="posts">
            <asp:FormView ID="FormView1" runat="server" DataKeyNames="DiscussionID" DataSourceID="SqlDataSource2"
                Width="869px" Font-Bold="True" Font-Italic="True" Font-Size="Medium" ForeColor="#FF6600"
                Height="81px">
                <EditItemTemplate>
                    Title:
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                        Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    Title:
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                        Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
                <ItemTemplate>
                    <br />
                    <span class="style2">Title: <em>
                        <asp:Label ID="TitleLabel" runat="server" Style="text-align: left" Text='<%# Bind("Title") %>' />
                    </em></span>
                    <br />
                </ItemTemplate>
            </asp:FormView>
            <br />
            <div>
                <strong><em>To rate this discussion, simply choose the scale from 1 - 5 by clicking
                    on the Volkswagen logo below and then click on rate.</em></strong>
                <asp:Rating ID="Rating1" runat="server" Width="233px" Height="40px" EmptyStarCssClass="stars"
                    FilledStarCssClass="filled" StarCssClass="ratingStar" WaitingStarCssClass="stars"
                    CurrentRating="0">
                </asp:Rating>
            </div>
            <div class="RateButton">
                <asp:Button ID="btnRate" runat="server" Height="34px" Text="Rate" Width="55px" CssClass="buttons" />
            </div>
        </div>
        <br />
        <div class="posts100">
        </div>
        Below are the posts replied to the discussion title shown above. To add a post to
        this discussion, simply enter your message into the textbox below and click on post.
    </div>
    <br />
    <div class="addNewPosts">
        <div class="style3">
            <strong>Average Rating<br />
                <div class="AverageRatingPostsAdd">
                    <asp:Label ID="lblAverageRatings" runat="server" Text="Label" Font-Size="Medium"
                        BorderStyle="Inset" Width="57px" Style="text-decoration: underline"></asp:Label>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Image ID="imgSmileyFace" runat="server" ImageUrl="~/Images/smileyface.png" />
                    <asp:Image ID="imgAngryFace" runat="server" Height="61px" ImageUrl="~/Images/angryface.png"
                        Width="61px" />
                </div>
            </strong>
        </div>
        <span class="st">
            <asp:TextBox ID="txtpost" runat="server" BorderStyle="Solid" Height="94px" TextMode="MultiLine"
                Width="434px" BorderColor="Silver" CssClass="textboxnormal"></asp:TextBox>
            &nbsp;<asp:Button ID="btnpost" runat="server" Height="31px" Text="Post" Width="64px"
                CssClass="buttons" />
            <br />
        </span>
    </div>
    <div class="postsUnedited">
        <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" Style="font-family: Calibri;
            font-size: small">
            <AlternatingItemTemplate>
                <strong>Post Message Replied:</strong>
                <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                <br />
                <strong>Date Posted:</strong>
                <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                <br />
                <strong>Time Posted:</strong>
                <asp:Label ID="TimePostedLabel" runat="server" Text='<%# Eval("TimePosted") %>' />
                <br />
                <strong>Posted by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
                <br />
                </span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <strong>Post Message Replied:</strong>
                <asp:TextBox ID="PostBodyTextBox" runat="server" Text='<%# Bind("PostBody") %>' />
                <br />
                Date Posted:
                <asp:TextBox ID="DatePostedTextBox" runat="server" Text='<%# Bind("DatePosted") %>' />
                <br />
                Time Posted:
                <asp:TextBox ID="TimePostedTextBox" runat="server" Text='<%# Bind("TimePosted") %>' />
                <br />
                <br />
                Posted by: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                <br />
                <br />
                </span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style=""><strong>Post Message Replied:</strong>
                    <asp:TextBox ID="PostBodyTextBox" runat="server" Text='<%# Bind("PostBody") %>' />
                    <br />
                    Date Posted:
                    <asp:TextBox ID="DatePostedTextBox" runat="server" Text='<%# Bind("DatePosted") %>' />
                    <br />
                    Time Posted:
                    <asp:TextBox ID="TimePostedTextBox" runat="server" Text='<%# Bind("TimePosted") %>' />
                    <br></br>
                    <br />
                    UserName: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                    <br />
                    <br />
                </span>
            </InsertItemTemplate>
            <ItemTemplate>
                <strong>Post Message Replied:</strong>
                <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                <br />
                <strong>Date Posted:</strong>
                <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                <br />
                <strong>Time Posted:</strong>
                <asp:Label ID="TimePostedLabel" runat="server" Text='<%# Eval("TimePosted") %>' />
                <br />
                <strong>Posted by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
                <br />
                </span>
            </ItemTemplate>
            <LayoutTemplate>
                <div id="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;
                    color: #000000;">
                    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                ShowPreviousPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                    <br />
                    <strong>Post Message Replied:</strong>
                    <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                    <br />
                    Date Posted:
                    <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                    <br />
                    Time Posted:
                    <asp:Label ID="TimePostedLabel" runat="server" Text='<%# Eval("TimePosted") %>' />
                    <br />
                    UserName: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                </span>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Posts.PostBody, Posts.DatePosted, Posts.TimePosted, Posts.DiscussionIDFK, Posts.PostID, aspnet_Users.UserName FROM (Posts INNER JOIN aspnet_Users ON Posts.UserIDFK = aspnet_Users.UserId) WHERE (Posts.DiscussionIDFK = ?) ORDER BY Posts.PostID DESC">
            <SelectParameters>
                <asp:QueryStringParameter Name="DiscussionIDFK" QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [DiscussionID], [Title] FROM [Discussion] WHERE ([DiscussionID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="DiscussionID" QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    </div>
</asp:Content>
